<template>
	<div>
		<el-card shadow="never">
			<!-- <h1>{{this.$router.currentRoute.name}}</h1> -->
			<el-table v-loading="loading" :data="tableData" style="width: 100%;margin-top: 20px">
				<el-table-column type="index" width="50"></el-table-column>
				<el-table-column label="用户ID" align="center"  prop="userId"></el-table-column>
				<!-- <el-table-column label="用户名称" align="center"  prop="userName"></el-table-column> -->
				<el-table-column label="用户类型" align="center" width="150" prop="type">
					<template scope="scope">
						<span v-if="scope.row.type == 1">代理商app;</span>
						<span v-if="scope.row.type == 2">店长app;</span>
						<span v-if="scope.row.type == 3">Pad端app;</span>
						<span v-if="scope.row.type == 4">用户端预约小程序;</span>
						<span v-if="scope.row.type == 5">店长端审批小程序;</span>
					</template>
				</el-table-column>
				<!-- <el-table-column label="组织机构" align="center"  prop="schemeName"></el-table-column> -->
				<el-table-column label="IP地址" align="center" prop="ip"></el-table-column>
				<el-table-column label="创建时间" align="center"  prop="createTime"></el-table-column>
			</el-table>
			<div style="margin-top: 20px;text-align: right">
				<el-pagination
					background
					@current-change="columnFind"
					:current-page="page.page"
					:page-size="page.pagesize"
					layout="prev, pager, next, jumper, total"
					:total="page.count"
				></el-pagination>
			</div>
		</el-card>
	</div>
</template>

<script>
	import Cookie from 'js-cookie';
	import {
		schemeLoginLog
	} from '../../../../server/index.js';
	export default {
		name: "",
		data() {
			return {
				tableData: [],
				page: {
					count: 0,
					pagesize: 10,
					page: 1
				},
				loading: true
			};
		},
		mounted() {
			var page = 1;
			this.columnFind(page);
			Cookie.remove('tabList');
		},
		methods: {
			columnFind(page) {
				const _this = this;
				_this.page.page = page;
				var obj = {
					page: _this.page.page,
					rows: _this.page.pagesize
				}
				this.http.request({
					url: schemeLoginLog,
					data: obj,
					success: function(res) {
						_this.loading = false;
						_this.tableData = res.list;
						_this.page.count = res.total;
					},
					error: function(err) {
						_this.$message({
							offset: '200',
							message: err.msg
						})
					}
				});
			}
		}
	};
</script>

<style>
</style>
